home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 141 / cdrom141.iso / aplic / ageletr / setup.exe / {code_GetDataFolder} / Templates / defaultAdvanced.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2007-02-25  |  14.8 KB  |  265 lines

  1.  ■<?xml version="1.0" encoding="UTF-16"?>
  2. <!--For advanced HTML rendering of QuickView.
  3. URL will be created for some fields.
  4. -->
  5. <xsl:stylesheet version="1.0"
  6. xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  7. <xsl:output method="html" />
  8.   <xsl:template match="/">
  9.     <html>
  10.       <body>
  11.         <xsl:for-each select="OpenContacts/Contacts/Contact">
  12.           <table border="0" width="100%" id="table2">
  13.             <tr>
  14.               <td width="80%">
  15.                 <font face="Times New Roman" size="3">
  16.                   <b>
  17.                     <xsl:value-of select="@Name"/>
  18.                   </b>
  19.                 </font>
  20.               </td>
  21.               <td>
  22.                 <xsl:value-of select="@Title"/>
  23.               </td>
  24.             </tr>
  25.           </table>
  26.           <div style="margin-left: 15px;">
  27.             <font size="2" color="#800000">
  28.               <xsl:apply-templates select="Notes"/>
  29.             </font>
  30.           </div>
  31.           <table border="0" width="100%" id="tablecompanies" cellspacing="0" cellpadding="0">
  32.             <xsl:for-each select="Companies/Company">
  33.               <tr>
  34.                 <td width="15"></td>
  35.                 <td width="80" bgcolor="#E0D601">
  36.                   <font face="Times New Roman" size="2">Company: </font>
  37.                 </td>
  38.                 <td bgcolor="#FFFCBF">
  39.                   <font size="3">
  40.                     <a href="idlink:{@ID}">
  41.                       <xsl:value-of select="@Name"/>
  42.                     </a>
  43.                   </font>
  44.                 </td>
  45.               </tr>
  46.             </xsl:for-each>
  47.           </table>
  48.           <table border="0" width="100%" id="tableLinkedContacts" cellspacing="0" cellpadding="0">
  49.             <xsl:for-each select="Contacts/Contact">
  50.               <tr>
  51.                 <td width="15"></td>
  52.                 <td width="80" bgcolor="#6CE26C">
  53.                   <font face="Times New Roman" size="2">Contact: </font>
  54.                 </td>
  55.                 <td bgcolor="#C7F3C7">
  56.                   <font size="3">
  57.                     <a href="idlink:{@ID}">
  58.                       <xsl:value-of select="@Name"/>
  59.                     </a>
  60.                   </font>
  61.                 </td>
  62.               </tr>
  63.             </xsl:for-each>
  64.           </table>
  65.           <table border="0" width="100%" id="tablecategories" cellspacing="0" cellpadding="0">
  66.             <xsl:for-each select="Categories/Category">
  67.               <tr>
  68.                 <td width="15"></td>
  69.                 <td width="80" bgcolor="#CCFF33">
  70.                   <font face="Times New Roman" size="2">Category: </font>
  71.                 </td>
  72.                 <td bgcolor="#E4FF95">
  73.                   <font size="3">
  74.                     <a href="calink:{@ID}">
  75.                       <xsl:value-of select="@Name"/>
  76.                     </a>
  77.                   </font>
  78.                 </td>
  79.               </tr>
  80.             </xsl:for-each>
  81.           </table>
  82.           <xsl:for-each select="Sections/Section">
  83.             <div style="margin-left: 15px;">
  84.               <b>
  85.                 <font face="Times New Roman" size="2">
  86.                   <xsl:value-of select="@Name"/>
  87.                 </font>
  88.               </b>
  89.             </div>
  90.             <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  91.               <xsl:for-each select="Fields/Field">
  92.                 <tr>
  93.                   <td width="15"></td>
  94.                   <td width="80" bgcolor="#C3D9FF">
  95.                     <font face="Times New Roman" size="2">
  96.                       <xsl:value-of select="@Name"/>:
  97.                     </font>
  98.                   </td>
  99.                   <td bgcolor="#E0ECFF">
  100.                     <font size="3">
  101.                       <xsl:choose>
  102.                         <xsl:when test="@Action='email'">
  103.                           <a href="mailto:{@Value}">
  104.                             <xsl:value-of select="@Value"/>
  105.                           </a>
  106.                         </xsl:when>
  107.                         <xsl:when test="@Action='web'">
  108.                           <a href="web:{@Value}">
  109.                             <xsl:value-of select="@Value"/>
  110.                           </a>
  111.                         </xsl:when>
  112.                         <xsl:when test="@Action='phone'">
  113.                           <a href="phone:{@Value}">
  114.                             <xsl:value-of select="@Value"/>
  115.                           </a>
  116.                         </xsl:when>
  117.                         <xsl:when test="@Action='skype'">
  118.                           <a href="skype:{@Value}">
  119.                             <xsl:value-of select="@Value"/>
  120.                           </a>
  121.                         </xsl:when>
  122.                         <xsl:when test="@Action='file'">
  123.                           <a href="local:{@Value}">
  124.                             <xsl:value-of select="@Value"/>
  125.                           </a>
  126.                         </xsl:when>
  127.                         <xsl:when test="@Action='image'">
  128.                           <a href="image:{@Value}">
  129.                             <xsl:value-of select="@Value"/>
  130.                           </a>
  131.                         </xsl:when>
  132.                         <xsl:when test="@Action='person'">
  133.                           <a href="person:{@Value}">
  134.                             <xsl:value-of select="@Value"/>
  135.                           </a>
  136.                         </xsl:when>
  137.                         <xsl:when test="@Action='org'">
  138.                           <a href="org:{@Value}">
  139.                             <xsl:value-of select="@Value"/>
  140.                           </a>
  141.                         </xsl:when>
  142.                         <xsl:otherwise>
  143.                           <xsl:value-of select="@Value"/>
  144.                         </xsl:otherwise>
  145.                       </xsl:choose>
  146.                     </font>
  147.                   </td>
  148.                 </tr>
  149.               </xsl:for-each>
  150.             </table>
  151.             <div style="margin-left: 15px;">
  152.               <font size="2" color="#800000">
  153.                 <xsl:apply-templates select="Notes"/>
  154.               </font>
  155.             </div>
  156.           </xsl:for-each>
  157.           <p>  </p>
  158.         </xsl:for-each>
  159.       </body>
  160.     </html>
  161.   </xsl:template>
  162.   
  163.   
  164.   <xsl:template match="Notes">
  165.       <xsl:call-template name="substitute">
  166.          <xsl:with-param name="string" select="." />
  167.       </xsl:call-template>
  168. </xsl:template>
  169.  <xsl:template name="substitute">
  170.    <xsl:param name="string" />
  171.    <xsl:param name="from" select="'&#xA;'" />
  172.    <xsl:param name="to">
  173.       <p/>
  174.    </xsl:param>
  175.    <xsl:choose>
  176.       <xsl:when test="contains($string, $from)">
  177.          <xsl:value-of select="substring-before($string, $from)" />
  178.          <xsl:copy-of select="$to" />
  179.          <xsl:call-template name="substitute">
  180.             <xsl:with-param name="string"
  181.                             select="substring-after($string, $from)" />
  182.             <xsl:with-param name="from" select="$from" />
  183.             <xsl:with-param name="to" select="$to" />
  184.          </xsl:call-template>
  185.       </xsl:when>
  186.       <xsl:otherwise>
  187.          <xsl:value-of select="$string" />
  188.       </xsl:otherwise>
  189.    </xsl:choose>
  190. </xsl:template>                
  191. </xsl:stylesheet>